home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_01_bab_alarm.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  218 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 01_BAB_Alarm.cog
  4. #
  5. # Guard warns Volodnikov about intruder in Babylon dig site
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. # .................................. MESSAGES ..................................
  16.  
  17.     message        startup
  18.     message        user4    # upon receipt, this cog revs up    
  19.     
  20. # .................................. KEYFRAMES .................................
  21.     
  22.     keyframe    vo_armsATback=vo_stand2_arms_back.key    local
  23.     keyframe    vo_backTOside=vo_stand2_bd_3.key        local
  24.     keyframe    vo_glassesL=0vo_glassesL_3_3.key        local
  25.     keyframe    vo_rightup=0vo_rightup_3_3.key            local
  26.     keyframe    vo_bothup=0vo_bothup_3_3.key            local
  27.  
  28. # .................................. SOUNDS ....................................
  29.  
  30.     sound        gd_fugitivesite=Bb08p01.wav                local
  31.     sound        vo_capturehim=Bb08v02.wav                local
  32.     sound        gd_yessir=Bb08p03.wav                    local
  33.  
  34.     sound        music0=mus_gen_russremin2.wav            local
  35.     
  36. # ............................... ACTOR THINGS .................................
  37.  
  38.     thing        alarm_guard                                nolink
  39.     thing        alarm_volod                                nolink
  40.      
  41. # .............................. OBJECT THINGS .................................
  42.  
  43.     thing        alarm_crate                                nolink
  44.     thing        alarm_statue                            nolink
  45.  
  46. # .............................. CAMERA THINGS .................................
  47.  
  48.     thing        alarm_cam_1                                nolink
  49.     thing        alarm_cam_2                                nolink
  50.         
  51.     thing        alarm_ct_1                                nolink
  52.     thing        alarm_ct_2                                nolink
  53.  
  54. # .............................. TARGET THINGS .................................
  55.  
  56.     thing        alarm_mk_1                                nolink
  57.     thing        alarm_mk_2                                nolink
  58.  
  59. # ........................ OTHER ENGINE REFERENCES .............................
  60.  
  61.     cog            generatorcog    
  62.     
  63.     template    ghost_tpl=ghost                            local
  64.     
  65. # ............................... VARIABLES ....................................
  66.     
  67.     flex        gd_rotRate                                local
  68.     flex        gd_headRate                                local
  69.     flex        vo_rotRate                                local
  70.     flex        vo_headRate                                local
  71.  
  72.     int            cutSceneState=0                            local
  73.  
  74.     int            gd_keyTrack1                            local
  75.     int            vo_keyTrack1                            local
  76.     int            vo_keyTrack2                            local
  77.  
  78.     int            cursound                                local
  79.     int            curcam                                    local
  80.  
  81.     int            gd_colltype                                local
  82.     int            vo_colltype                                local
  83.     
  84. end
  85.  
  86. # ==============================================================================
  87.  
  88. code
  89.  
  90. # ..............................................................................
  91.  
  92. startup:
  93.  
  94.     # Prepare for much later...
  95.     SetThingFlags(alarm_guard, 0x80000);
  96.     SetThingFlags(alarm_volod, 0x80000);
  97.     SetThingFlags(alarm_crate, 0x80000);
  98.     SetThingFlags(alarm_statue, 0x80000);
  99.     cutSceneState = 0;
  100.  
  101.     return;
  102.  
  103. # ..............................................................................
  104.  
  105. user4:
  106.  
  107.     # Message from the generator cog triggers the alarm cutscene...
  108.  
  109.     if (cutSceneState != 0)
  110.     {
  111.         # Only run cutscene once...
  112.         return;
  113.     }
  114.  
  115.     # Prep engine...
  116.     cutSceneState = 1;
  117.     
  118.     # Prep...
  119.     ClearThingFlags(alarm_volod, 0x80000);
  120.     ClearThingFlags(alarm_guard, 0x80000);
  121.     ClearThingFlags(alarm_crate, 0x80000);
  122.     ClearThingFlags(alarm_statue, 0x80000);
  123.     gd_colltype = GetCollideType(alarm_guard);
  124.     gd_rotRate = GetThingMaxRotVel(alarm_guard);
  125.     gd_headRate = GetThingMaxHeadVel(alarm_guard);
  126.     vo_rotRate = GetThingMaxRotVel(alarm_volod);
  127.     vo_headRate = GetThingMaxHeadVel(alarm_volod);
  128.     AISetCutSceneMode(alarm_volod);
  129.     AISetCutSceneMode(alarm_guard);
  130.     SetWeaponModel(alarm_guard, 4);
  131.  
  132.     # Prep Volodnikov...
  133.     vo_keyTrack1 = PlayKey(alarm_volod, vo_armsATback, 2, 0x10, 0);
  134.  
  135.     # Cut to shot of Volodnikov...
  136.     curcam = GetCurrentCamera();
  137.     SetCameraLookInterp(2, 0);
  138.     SetCameraPosInterp(2, 0);
  139.     SetCameraFocus(2, alarm_cam_1);
  140.     SetCameraSecondaryFocus(2, alarm_ct_1);
  141.     SetCurrentCamera(2);
  142.     SetCameraFOV(60, 0, 0.0);
  143.     
  144.     # Maybe a touch of melodramatic music...
  145.     # PlaySoundLocal(music0, 0.8, 0.0, 0x0, 0);    
  146.     
  147.     # Volodnikov fidgets...
  148.     StopKey(alarm_volod, vo_keyTrack1, 0.0);
  149.     PlayKey(alarm_volod, vo_backTOside, 4, 0x12, 1);
  150.     PlayKey(alarm_volod, vo_glassesL, 4, 0x12, 0);
  151.  
  152.     # A guard appears outside room...
  153.     SetCollideType(alarm_guard, 0);
  154.     SetCollideType(alarm_volod, 0);
  155.     AISetMoveSpeed(alarm_guard, 0.9);
  156.     AISetLookThingEyeLevel(alarm_guard, alarm_mk_1);
  157.     AISetMoveThing(alarm_guard, alarm_mk_1, 0);
  158.     AISetLookThingEyeLevel(alarm_guard, alarm_volod);
  159.     Sleep(0.8); # was 0.2
  160.         
  161.     # Guard: "Comrade Doctor V...fugitive in the site!"
  162.     cursound = PlayVoice(alarm_guard, gd_fugitivesite, 1.0, 0);
  163.  
  164.     # Volodnikov turns to face sailor...
  165.     SetThingMaxHeadVel(alarm_volod, 180.0);
  166.     SetThingMaxRotVel(alarm_volod, 120.0);
  167.     AIEnableBodyTracking(alarm_volod, alarm_guard);
  168.  
  169.     # Re-frame toward doorway...
  170.     SetCameraLookInterp(2, 1);
  171.     SetCameraPosInterp(2, 1);
  172.     SetCameraInterpSpeed(2, 2.0);
  173.     Sleep(0.01);
  174.     SetCameraFocus(2, alarm_cam_2);
  175.     SetCameraSecondaryFocus(2, alarm_ct_2);
  176.     SetCameraFOV(45, 1, 2.0);
  177.  
  178.     AIWaitForStop(alarm_guard);
  179.     WaitForSound(cursound);
  180.     Sleep(0.1);
  181.  
  182.     # Volodnikov: "Capture him if possible!  Otherwise shoot the dog!"
  183.     AIDisableBodyTracking(alarm_volod);
  184.     cursound = PlayVoice(alarm_volod, vo_capturehim, 1.0, 0);
  185.     PlayKey(alarm_volod, vo_rightup, 4, 0x12, 1);
  186.     Sleep(1.3);
  187.     PlayKey(alarm_volod, vo_bothup, 4, 0x12, 0);
  188.     WaitForSound(cursound);
  189.  
  190.     # Guard: "Yes, sir!"
  191.     cursound = PlayVoice(alarm_guard, gd_yessir, 1.0, 0);
  192.  
  193.     # Guard exits...
  194.     AISetLookThingEyeLevel(alarm_guard, alarm_mk_2);
  195.     Sleep(0.5);
  196.     AISetMoveThing(alarm_guard, alarm_mk_2, 0);
  197.  
  198.     # Volodnikov turns back to statue...
  199.     AISetLookThing(alarm_volod, alarm_statue);
  200.     Sleep(2.0);
  201.  
  202.     # Clean up...
  203.     SetCameraLookInterp(2, 0);
  204.     SetCameraPosInterp(2, 0);
  205.     
  206.     # Return control to the generator cog...
  207.     SendMessage(generatorcog, user4);
  208.     Sleep(0.1);
  209.  
  210.     DestroyThing(alarm_guard);
  211.     DestroyThing(alarm_volod);
  212.     DestroyThing(alarm_crate);
  213.     DestroyThing(alarm_statue);
  214.  
  215.     return;
  216.  
  217. end
  218.